Skip to content

fix(tests): restore collection and repair stale test imports (task-coding-0007) - #5

Merged
Flissel merged 4 commits into
masterfrom
codex/coding/task-coding-0007-test-suite-repair-v1
Aug 17, 2026
Merged

fix(tests): restore collection and repair stale test imports (task-coding-0007)#5
Flissel merged 4 commits into
masterfrom
codex/coding/task-coding-0007-test-suite-repair-v1

Conversation

@Flissel

@Flissel Flissel commented Aug 17, 2026

Copy link
Copy Markdown
Owner

What this fixes, and what it deliberately does not

Four focused commits, 31 insertions / 13 deletions across 7 files, all under tests/. No product code changed.

Commit Fix
1578ff2 restore the orchestrator conftest import after runner archival
09056ba import src.registry names from their submodules
f120ee5 mirror EpicOrchestrator.db_sync default in test helpers
1c80b0a stop src/ landing on sys.path and shadowing the stdlib secrets module

The blocker, reproduced independently

I ran this myself in a clean clone. On unmodified master:

E   ModuleNotFoundError: No module named 'run_orchestrator'
Interrupted: 1 error during collection
1 error in 0.14s

The entire session dies in 0.14 seconds. Over 13,000 tests were never collected. That is what continue-on-error: true on the test job has been concealing.

The suite is NOT green, and that is the honest outcome

My own run on this branch: 45 failed, 13400 passed, 60 skipped, 7 errors. The handoff reports 45 failures and 7 errors for pytest tests/ -v --tb=short, which matches; its 39/13256 figure is from a different invocation, and my pass/skip counts differ slightly from that one because my venv resolved some optional dependencies differently. Both agree on what matters: not green.

What changed is nevertheless the whole point of stage 1: the masking now conceals a measured, itemised 45+7 instead of an unknown behind an abort that executed zero tests.

The session also confirmed task-coding-0006's baseline by re-measuring rather than trusting it: 49 failed / 13242 passed / 55 skipped / 9 errors at 352a858 — exactly as reported.

Judgment worth highlighting

Before choosing the repair, the session measured what the alternative would cost — via PYTHONPATH rather than an edit: tests/orchestrator yields 24 failed, 126 passed, 5 skipped. That measurement ruled out retiring the directory into _archive/old_tests/, even though that is the repository's own precedent from the very same commit (aa41933), because it would have thrown away 126 passing tests. Checking the cost of deletion before deleting is exactly right.

No test was weakened, skipped, xfail-ed or deleted to reach a nicer number.

What remains, itemised rather than summarised

39 of the 52 remaining items are genuine product defects and were deliberately not fixed — per-item evidence in §3.2 of the handoff, with ten follow-ups proposed as CE-1..CE-10.

The highest-priority one is worth stating here: the entire src/engine/validators/ package is unimportable in a fresh clone. All eight modules do from src.engine.validators import SpecValidator, SpecValidator is defined nowhere in the repository, and no __init__.py is tracked because .gitignore swallows it.

13 items are environment or dependency artefacts, not code findings. Chief among them a real pin conflict: requirements.txt:4 pins pydantic==2.10.3, but autogen-ext[mcp]>=0.5 needs mcp>=1.11.0 which needs pydantic>=2.11 — so pip resolves back to autogen-ext 0.4.5, whose tools/ has no mcp submodule, breaking 4 items. Meanwhile CLAUDE.md documents the intended version as autogen-agentchat 0.7.5. Verified with pip install 'autogen-ext[mcp]==0.7.5' --dry-run, which wants pydantic 2.13.4.

Consequence for stage 2

task-coding-0008 cannot un-mask the test job. Doing so would make CI permanently red — the exact outcome the staging exists to prevent. I will re-scope it and put the product defects to the user rather than quietly widening a routine task into them.

Evidence

  • docker compose config → exit 0, and likewise for the customer-deploy and fungus compose files. docker-validate remains the only blocking CI job and it is green
  • superproject pytest tests/v1_governance -q → 257 passed
  • session validate → approved, run against the request on master — the predecessor blocker from 0034/0006 did not recur, because the admission merged first this time
  • auditdirty_paths [], submodule never initialized; git status --short empty in both worktrees. Isolation: real git worktree in both repositories

coding-engine/la_fungus_search still pins the dangling f731c19a — excluded by user decision, not touched, no recursive init attempted.


Generated by Claude Code

claude added 4 commits August 17, 2026 12:14
tests/orchestrator/conftest.py imported run_orchestrator from the project
root. The root cleanup in aa41933 moved 18 runner scripts into
_archive/old_runners/ without updating their tests, so the import raised
ModuleNotFoundError. Because it happens in a conftest, pytest aborted the
entire session at collection: `pytest tests/` ran zero tests.

Keep the archived location importable instead of retiring the tree - the
directory still contains 126 passing tests, including live coverage of
mcp_plugins/servers/grpc_host/epic_orchestrator.py, which is not archived.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GfTCs4rYUGstkDRSTYcBGx
Both files did `from src.registry import DocumentRegistry, ...`, which needs
an __init__.py re-export. src/registry/ has none - .gitignore:79 (`_*.py`,
intended for temporary root-level debug scripts) matches __init__.py at any
depth, so no package initialiser is tracked anywhere under src/.

Use the same submodule import form the rest of the repository already uses
(src/agents/*.py, src/mind/orchestrator.py). No assertion changed; the two
collection errors become 4 executing tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GfTCs4rYUGstkDRSTYcBGx
Both make_orchestrator() helpers build the orchestrator via __new__ with
__init__ patched out, then hand-set the attributes the tests need. The real
__init__ grew `self.db_sync = None` (epic_orchestrator.py:204) and the
helpers were not updated, so _update_task_status() raised AttributeError in
18 tests.

Mirror the real default rather than guarding the product code: with None,
_update_task_status() skips the live DB write, which is exactly what the
real constructor does when DBTaskSync is unavailable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GfTCs4rYUGstkDRSTYcBGx
These two files were the only ones inserting src/ itself at sys.path[0].
src/secrets.py then shadows the stdlib secrets module for every test that
runs later in the same session, so secrets.token_bytes disappeared and
tests/agents/test_infrastructure_agent.py (9) and
tests/test_system_validation.py (1) failed in a full run while passing in
isolation.

Switch both to the convention the other 419 test files use: project root on
sys.path, import via src.services.*. src/ is the only directory carrying a
stdlib-shadowing module name; src/services/ carries none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GfTCs4rYUGstkDRSTYcBGx
@Flissel
Flissel marked this pull request as ready for review August 17, 2026 12:30
@Flissel
Flissel merged commit ec95876 into master Aug 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants